package com.ee.chat.common.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ee.chat.common.entity.UserWithdrawLog;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.Map;

/**
 * <p>
 * Mapper接口
 * </p>
 *
 * @author Shane
 * @since 2019-09-04
 */
public interface UserWithdrawLogMapper extends BaseMapper<UserWithdrawLog> {
    /**
     * 根据订单号查询
     * @Author Shane
     * @Date 2019/10/6 18:03
     * @param
     * @return
     */
    UserWithdrawLog selectByOrderNumber(@Param("orderNumber") String orderNumber);

    /**
     * 获取提现记录
     * @Author Shane
     * @Date 2019/10/6 19:08
     * @param
     * @return
     */
    IPage<Map<String, Object>> getWithdrawLogs(Page page, @Param("userId") Integer userId);

    /**
     * 提现列表
     * @Author Shane
     * @Date 2019/10/24 0:09
     * @param
     * @return
     */
    IPage<Map<String, Object>> list(Page page, @Param("userId") Integer userId, @Param("status") Integer status, @Param("type") Integer type,
                                    @Param("beginTime") Date beginTime, @Param("endTime") Date endTime,
                                    @Param("field") String field, @Param("sort") String sort);

    /**
     * 获取用户指定时间的体现记录数
     * @param userId
     * @param beginTime
     * @param endTime
     * @return
     */
    int getUserWithdrawLogCount(@Param("userId") Integer userId, @Param("beginTime") Date beginTime, @Param("endTime") Date endTime);

    /**
     * 获取提现申请数额统计
     * @return
     */
    Double getWithdrawSate(@Param("beginTime") Date beginTime, @Param("endTime") Date endTime);

    /**
     * 获取提现审核数额统计
     * @return
     */
    Double getWithdrawAuditSate(@Param("status") Integer status, @Param("beginTime") Date beginTime, @Param("endTime") Date endTime);
}